﻿using RpcHelper;
using RpcSync.Model;
using RpcSync.Service.Interface;

namespace RpcSync.Service.Node
{
    internal class NodeServer : INodeServer
    {
        public NodeServer(SystemType[] types)
        {
            _LowerNode = types.ConvertAll(a => new RootNode
            {
                Dictate = a.TypeVal,
                Id = a.Id
            }); ;
        }
        private readonly RootNode[] _LowerNode = null;

        public void Load(List<RootNode> dictates)
        {
            dictates.AddRange(_LowerNode);
        }
        public void Load(List<long> sysTypeId)
        {
            _LowerNode.ForEach(c => {
                sysTypeId.Add(c.Id);
            });
        }
    }
}
